package juc.c_001;/*
   Talk is cheap. Show me the code.
 */

import java.util.concurrent.TimeUnit;

/**
 * @Description 可重入
 * @Date 2021/6/6
 * @Author liudl
 */
public class T9 {
    public synchronized void m1() throws InterruptedException {
        System.out.println("m1 Start...");
        m2();
        TimeUnit.SECONDS.sleep(2);
        System.out.println("m1 End...");
    }
    public synchronized void m2() throws InterruptedException {
        TimeUnit.SECONDS.sleep(1);
        System.out.println("m2");
    }

    public static void main(String[] args) throws InterruptedException {
        new T9().m1();
    }
}
